/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wli.web.db;

import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 *
 * @author liw
 */
public class VocabularyHelper {

    Session session = null;

    public VocabularyHelper() {
        this.session = HibernateUtil.getSessionFactory().getCurrentSession();
    }

    public List getVocabularyList() {
        List<Vocabulary> vocList = null;
        try {
            Transaction tx = session.beginTransaction();
            Query q = session.createQuery("from Vocabulary");
            vocList = (List<Vocabulary>) q.list();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return vocList;
    }
}
